
<h1><span class="yiyi-st" id="yiyi-13">numpy.ma.allequal</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.allequal.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.allequal.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="function">
<dt id="numpy.ma.allequal"><span class="yiyi-st" id="yiyi-14"> <code class="descclassname">numpy.ma.</code><code class="descname">allequal</code><span class="sig-paren">(</span><em>a</em>, <em>b</em>, <em>fill_value=True</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/ma/core.py#L7353-L7408"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-15">如果a和b的所有条目都相等，则返回True，使用fill_value作为其中一个或两者都被掩蔽的真值。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-16">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-17"><strong>a，b</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-18">输入数组进行比较。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-19"><strong>fill_value</strong>：bool，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-20">a或b中的掩码值是否被视为等于（True）或不等于（False）。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-21">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-22"><strong>y</strong>：bool</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-23">如果两个数组在给定容差内相等，则返回True，否则返回False。</span><span class="yiyi-st" id="yiyi-24">如果数组包含NaN，则返回False。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-25">也可以看看</span></p>
<p class="last"><span class="yiyi-st" id="yiyi-26"><a class="reference internal" href="numpy.ma.all.html#numpy.ma.all" title="numpy.ma.all"><code class="xref py py-obj docutils literal"><span class="pre">all</span></code></a>，<a class="reference internal" href="numpy.ma.any.html#numpy.ma.any" title="numpy.ma.any"><code class="xref py py-obj docutils literal"><span class="pre">any</span></code></a>，<a class="reference internal" href="numpy.ma.allclose.html#numpy.ma.allclose" title="numpy.ma.allclose"><code class="xref py py-obj docutils literal"><span class="pre">numpy.ma.allclose</span></code></a></span></p>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-27">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">ma</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="n">e10</span><span class="p">,</span> <span class="mi">1</span><span class="n">e</span><span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="mf">42.0</span><span class="p">],</span> <span class="n">mask</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span>
<span class="go">masked_array(data = [10000000000.0 1e-07 --],</span>
<span class="go">      mask = [False False  True],</span>
<span class="go">      fill_value=1e+20)</span>
</pre></div>
</div>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">array</span><span class="p">([</span><span class="mi">1</span><span class="n">e10</span><span class="p">,</span> <span class="mi">1</span><span class="n">e</span><span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="o">-</span><span class="mf">42.0</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span>
<span class="go">array([  1.00000000e+10,   1.00000000e-07,  -4.20000000e+01])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ma</span><span class="o">.</span><span class="n">allequal</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">fill_value</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ma</span><span class="o">.</span><span class="n">allequal</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>
